class Solution {
public:
    vector<int> preorderTraversal(TreeNode* root)
    {
        if (!root)
        return ret;
        ret.push_back(root->val);
        preorderTraversal(root->left);
        preorderTraversal(root->right);
        return ret;
    }
public:
    vector<int> ret;
    
};